<template>
	<view class="box"> 
	
	    <view class="content">
	    	<view class="fontweight">服务地址</view>
			<!-- <u-cell  :rightIconStyle="rightIconStyle" :border='false'  title="在线状态"  >
				<view    slot="value"    class="u-slot-value">
					<view v-if="userInfo.isOnline"  style="font-size: 13px; color:#00ac4e;">在线中</view>
					<view v-if="userInfo.isOnline==false"style="font-size: 13px; color:#606266;">下线中</view>
				</view>
			</u-cell> -->
			<u-cell :rightIconStyle="rightIconStyle" :border='false'  title="所在区域" value="桂林市七星区" 
			:isLink="true" arrow-direction="left"  @click="addressShow = true;"></u-cell>
			
			<!-- <u-cell  :rightIconStyle="rightIconStyle" :border='false'  title="自接单派单" label="担心漏单？开启后自动接派单"  >
				<view    slot="value"    class="u-slot-value">
					<u-switch v-model="userInfo.isDispatch" size="15" activeColor="#00ac4e"  inactiveColor="#c5c4c8"></u-switch>
				</view>
			</u-cell> -->
			<view class="" style="margin-left: 15px;">
				详细地址
				<uni-easyinput type="textarea" autoHeight v-model="value" placeholder="请输入内容"></uni-easyinput>
			</view>
			
			<view class="btn">
				<u-button  v-if="userInfo.isOnline==false" @click="isOnlineClick(true)" :plain="true" shape="circle" size="small" text="提交"></u-button>
				<u-button  v-if="userInfo.isOnline"  @click="isOnlineClick(false)":plain="true" shape="circle" size="small" text="点击下线"   type="success"></u-button>
			</view>
		</view>
		
		<view>
			<address-picker :show="addressShow" closeOnClickOverlay @confirm='confirmAddress' @cancel='addressShow=false'
			    @close='addressShow = false' :address-data="addressData" :indexs="indexs" :areaId="areaId" :type="type"></address-picker>
		</view>
	</view>
</template>

<script>
	import {
	    mapState 
	} from 'vuex';
	import {
	    mapMutations  
	} from 'vuex';
	export default {
		data() {
			return {
				rightIconStyle:{
						 color: '#d8d8d8'
				},
				switchValue:true,
				citySelector:'/pagesB/index/citySelector',//失物招领
				address: '',
				addressShow: false,
				indexs: [0, 0, 0],
				areaId: [1, 110000, 110101],
				addressData: ['北京市', '北京市', '东城区'],
				type: 3, //1-省，2-省市，3-省市区
			}
		},
		computed: {
			...mapState(['userInfo'])
		},
		methods: {
			...mapMutations(['login']),
			//点击上线
			isOnlineClick(itme){
				/* uni.getStorage({
					key: 'LoginTK',
					success: (res) => {
						res.data.isOnline=itme
						//更新登录信息
						this.login(res.data);
						//console.log("	//登录信息",JSON.stringify(res.data))
					}
				}) */
			},
			asyncChange(e) {
				console.log(e)
				uni.showModal({
					content: e ? '确定要打开吗' : '确定要关闭吗'+e,
					success: (res) => {
						if (res.confirm) {
							this.value13 = e
						}
					}
				})
			},
			navigateTo(urls) {
				uni.navigateTo({
				   url: urls
				});
			},
			//地区选择返回结果
			confirmAddress(val) {
			    console.log(val);
			    this.address = val.value.join('')
			    this.addressShow = false
			}
		}
	}
</script>

<style lang="scss" scoped>
.box{
	margin-top: 10rpx;
	padding: 0px 10px;
	
}
.content{
	background-color: white;
	//padding:10px ;
	.btn{
		padding: 10px;
	}
}
.fontweight{
	font-weight: 550;
	margin-left: 11px;
	padding-top: 10px;
}
</style>
="常驻区域" value="桂林市七星区"label="担心漏单？开启后自动接派单" :isLink="true" arrow-direction="left">
				<text